package com.leyou.common.auth.entity;

/**
 * @author syf
 * @version 1.0
 * @date 2019/08/17 10:53
 * @Description TODO:获取登陆后的用户id
 */

public class UserHolder {
    //和当前线程做绑定
    private static ThreadLocal<String> TL=new ThreadLocal<>();

    public static void setUserId(String userId){
        TL.set(userId);
    }

    public static String getUserId(){
        return TL.get();
    }

    public static void removeUserId(){
        TL.remove();
    }
}
